<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        #box {
            width: 200px;
            height: 200px;
            background-color: lightblue;
        }
        .hide {
            display: none;
        }
        .show {
            display: block;
        }
    </style>
</head>
<body>
<input type="button" value="隐藏" onclick="showOrHide(this)">
<div id="box">
    showOrHide
</div>
<script>


    function showOrHide(btn) {
        //
        var box = document.getElementById("box");

        if (btn.value === "隐藏") {
            box.className = "hide";
            btn.value = "显示";
         }else{
            box.className = "show";
            btn.value = "隐藏";
        }
    }
</script>
</body>
</html>